<?php
namespace app\api\controller;

use app\common\model\User;
use think\Controller;

Class V1 extends Common{

	public function get_user_info()
	{
		$res = User::all();

		$this->success($res);
	}

	public function get_user()
	{
		if(!input('uid')){
			$this->error(10001,'id inviid');
		}
		$res = User::get(input('uid'));
		
		if($res){
			$this->success($res);
		}else{
			$this->error(10002,'user not exists');
		}
	}

	public function user()
	{
		if(!input('uid')){
			exit(json_encode(['code'=>10001,'msg'=>'uid inviid']));
		}

		$res = User::get(input('uid'));

		if($res){
			exit(json_encode(['code'=>0,'msg'=>'success','data'=>$res]));
		}else{
			exit(json_encode(['code'=>10002,'msg'=>'user not exists']));
		}
	}

	public function get_quetion()
	{
		
	}
}
